
function setCookie(c_name,value,expiredays)
    {
        //alert(c_name + ","+value);
    var exdate=new Date();
    exdate.setDate(exdate.getDate()+expiredays);
    document.cookie = (c_name+ "=" +escape(value)+
    ((expiredays==null) ? "" : ";expires="+exdate.toGMTString()));
//    alert(document.cookie);
    }
    
    function getCookie(c_name, default_value)
    {
        if (document.cookie.length>0)
          {
          c_start=document.cookie.indexOf(c_name + "=");
          if (c_start!=-1)
            {
            c_start=c_start + c_name.length+1;
            c_end=document.cookie.indexOf(";",c_start);
            if (c_end==-1) c_end=document.cookie.length;
            return unescape(document.cookie.substring(c_start,c_end));
            }
          }
        setCookie(c_name, default_value, 100111);
        return default_value;
    }
    
    function updatePortletCookies() {
        
    setCookie("portlet_position_preferences", document.getElementById('portlet_preferences').parentNode.id, 100);
    setCookie("portlet_position_statistics", document.getElementById('portlet_statistics').parentNode.id, 100);
    setCookie("portlet_position_quicklinks", document.getElementById('portlet_quicklinks').parentNode.id, 100);
    }